<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>layout 后台大布局 - Layui</title>
<link rel="stylesheet" href="/layui-v2.0.1/layui/css/layui.css">
<link rel="stylesheet" href="/css/admin.css">

</head>
<body>
<div class="layui-layout layui-layout-admin">
   @include('admin.header')
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
       @include('admin.leftadmin')
    </div>
  </div>
  
  <div class="layui-body">
    <!-- 内容主体区域 -->
   <div style="padding: 15px;">内容主体区域</div>
  <!--  <form action="doaddfactor" method="post" style="width:500px;margin-top: 20px;margin-left: 50px"> -->
  <div style="width:600px">
    <div class="layui-form-item">
    <label class="layui-form-label">顺位选择</label>
    <div class="layui-input-block">
      <select class="lien" lay-filter="aihao" style="height:37px;width:100px">
        <option value="1" selected="">第一顺位</option>
        <option value="2">第二顺位</option>
        <option value="3">第三顺位</option>
      </select>
    </div>
    </div>
    <div class="layui-form-item" style="margin-top: 20px">
      <label class="layui-form-label">顺位值</label>
      <div class="layui-input-block" style="width:300px">
        <input type="text" class="lien_number" lay-verify="required" value="" autocomplete="off" class="layui-input" style="height: 30px">
      </div>
    </div>
    <label class="layui-form-label">含义</label>
     <div class="layui-form-item" style="margin-left: 110px" >
      
      <textarea class="layui-textarea" id="LAY_demo1" style="display: none" name="explanination" lay-verify="required">  
         填写含义
     </textarea>
    </div>
     <div class="layui-form-item" style="margin-top: 20px">
      <div class="layui-input-block">
        <button class="layui-btn addfactor" lay-submit="" lay-filter="demo1">确认添加</button>          
      </div>
     </div> 
    </div>

<!--    </form> -->
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script src="/layui-v2.0.1/layui/layui.js"></script>
<script>
//JavaScript代码区域
layui.use(['element',], function(){
  var element = layui.element;
  
});


</script>
</body>
</html>
<script>
layui.use('layedit', function(){
  var layedit = layui.layedit
  ,$ = layui.jquery;
  
  //构建一个默认的编辑器
  var index = layedit.build('LAY_demo1');
  
  //编辑器外部操作


  //自定义工具栏

});
</script>
<script>

layui.use('layer', function(){
$(function(){
  //var index = parent.layer.getFrameIndex(window.name);
  $('.addfactor').click(function(){
  var lien = $('.lien').val();
  var lien_number = $('.lien_number').val();
  var explanination = $('.layui-textarea').val();
  if(lien_number==""||explanination==""){
    layer.msg('选项不能为空');
  }else{
    $.ajax({
      url:'/admin/order/doaddfactor',
      type:'post',
      data:{'lien':lien,'lien_number':lien_number,'explanination':explanination},
      dataType:'json',
      success:function(d){
        if(d.code==20){           
         // window.location.reload();
          layer.msg(d.msg,{
              icon: 1,
              time: 1000 //2秒关闭（如果不配置，默认是3秒）
              }, function(){
                window.loaction.reload();
        });
        }else{
          layer.msg(d.msg);
        }
      }
    })
   }
  })
 })
})

</script>


